<div>
  <div class="tree-item" (click)="toggleExpand($event)">
    <div class="tree-item-indent" [style.textIndent]="indent+'em'" title="{{ title }}" (contextmenu)="showContextMenu()">
      <div [ngClass]="[expanded?'expanded':'noexpanded']"></div><img [ngClass]="['tree-icon']" [src]="dirName|folderIcon:expanded" alt="">{{ dirName }}
    </div>
  </div> 
  <div class="tree-sub-dir" *ngIf="expanded">
    <div *ngFor="let file of child;let i = index;">    
      <!--目录-->
      <tree-dir *ngIf="file.type=='dir'"
        [title]="file.fullPath"
        [dirName]="file.name"
        [expanded]="file.expanded"
        [child]="file.child" 
        (fileSelect)="select($event)"
        (dblFileSelect)="dblSelect($event)"
        [indent]="indent+1" 
        [paths]="nextPath()"
        [index]="i"
        [pathsIndexs]="nextPathIndexs()">
      </tree-dir>
      <!--文件-->
      <tree-file *ngIf="file.type=='file'" 
        [title]="file.fullPath"
        [fileName]="file.name" 
        (fileSelect)="select($event)"
        (dblFileSelect)="dblSelect($event)"       
        [indent]="indent+1"></tree-file>
    </div>
  </div>
  
</div>
